home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / multimon.pxl < prev    next >
Text File  |  2001-09-20  |  5KB  |  195 lines

  1. {    Filename    :     multimon.pxl
  2.      Purpose    :    <purpose>
  3.     Date        :    October 27, 1999
  4.     Author        :    Stewart DIBBS, VYSOR Integration Inc
  5. History:
  6.  
  7.     Version    :      4.40    RELEASE
  8.     Update        :  
  9.     Date        :  
  10.  
  11. --------------------------------------------------------------------------}
  12. Initialize: {only one instance allowed}
  13.     UseCoordinates(PIXEL)
  14.     Title$ = "PiXCL 5.0 and Multiple Monitors"                                  
  15.     WinExist(Title$,Res)
  16.     If Res = 0 Then Goto One_Instance
  17.     Beep
  18.     WinSetActive(Title$,Res)
  19.     WinShow(Title$,RESTORE,Res)
  20.     End
  21. One_Instance:
  22.     UseCaption(Title$) {change the title}
  23.     WinLocate(Title$,349,107,1100,641,Res)                
  24.     UseBackground(TRANSPARENT,0,128,192)     
  25.     WinShow(Title$,NOTOPMOST,Res) 
  26.     DrawBackGround
  27.     DirGet(SourceDir$) {used later for library function calls}
  28.  
  29.     {DragAcceptFile(ENABLE,AcceptFile)}
  30.     {AutoProgressBar(DISABLE)}
  31.  
  32.     InfoMenu(REMOVE)
  33.     WaitInput(100)
  34.     SetMenu("&File",IGNORE,
  35.         "&New",CreatingFile,
  36.         "&Open",OpeningFile,
  37.         "&Save",SavingFile,
  38.         SEPARATOR,
  39.         "E&xit!",Terminate,
  40.         ENDPOPUP,
  41.         "&View",IGNORE,
  42.         "&ToolBar",ViewToolBar,
  43.         "&StatusBar",ViewStatusBar,
  44.         ENDPOPUP,
  45.         "&Information",IGNORE,
  46.         "&Concept",Concept,
  47.         "&Help",ShowAppHelp,
  48.         SEPARATOR,
  49.         "&About",About,
  50.         ENDPOPUP)
  51.  
  52.     GoSub MakeToolbar
  53.     ChangeMenuItem("&ToolBar",CHECK,TBRes)
  54.  
  55.         
  56.     StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
  57.     DrawStatusWinText(0,"Ready")
  58.     ChangeMenuItem("&StatusBar",CHECK,SBRes)
  59.  
  60.     SetMouse(0,0,2500,1024,OpeningFile,n,n)
  61.  
  62.     
  63. Wait_for_Input:
  64.     WaitInput()
  65.  
  66. Terminate:
  67.     End
  68.  
  69.  
  70. Concept:
  71.     MessageBox(OK,1,INFORMATION,
  72. "This is a skeleton of a PiXCL application.  You could briefly
  73. describe your application's function here, or provide some
  74. basic help information.",
  75.     "PiXCL Skeleton Concept",Res)
  76.  
  77.     Goto Wait_for_Input
  78.  
  79. ShowAppHelp:
  80.     {An application Help file usually has the same name as the application.}
  81.     Winhelp("multimon.hlp",CONTENTS,"")
  82.  
  83.     Goto Wait_for_Input
  84.  
  85. About:
  86.     AboutUser("PiXCL 5.1 and Multiple Monitors",  { or substitute Title$}
  87.       "Two lines of text goes here e.g. Application function.",
  88.     "Four Lines of additional information goes here, perhaps contact information and Web addresses")   
  89.  
  90.     Goto Wait_for_Input
  91.  
  92. ViewToolBar:
  93.     GetMenuStatus("&ToolBar",CHECKED,Res)
  94.     If Res = 0
  95.         GoSub MakeToolbar
  96.         ChangeMenuItem("&ToolBar",CHECK,Res)
  97.     Else
  98.         Toolbar()
  99.         ChangeMenuItem("&ToolBar",UNCHECK,Res)
  100.     Endif
  101.     Goto Wait_for_Input
  102.  
  103. ViewStatusBar:
  104.     GetMenuStatus("&StatusBar",CHECKED, Res)
  105.     If Res = 0
  106.         StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
  107.         DrawStatusWinText(0,"Ready")
  108.         ChangeMenuItem("&StatusBar",CHECK,Res)
  109.     Else
  110.         StatusWindow(DISABLE,BOTTOM,2,200,-1,0,0)
  111.        ChangeMenuItem("&StatusBar",UNCHECK,Res)
  112.     Endif
  113.     Goto Wait_for_Input
  114.  
  115. CreatingFile:
  116.     WaitInput(1)
  117.     DrawBackground
  118.     WinGetClientRect(Title$,wx1,wy1,wx2,wy2)
  119.  
  120.     EnumDisplayMonitors(m1x1,m1y1,m1x2,m1y2, Monitor_1_Name$,
  121.     m2x1,m2y1,m2x2,m2y2, Monitor_2_Name$)
  122.     
  123.     DrawNumber(20,40,m1x1) DrawNumber(80,40,m1y1) 
  124.     DrawNumber(100,80,m1x2) DrawNumber(160,80,m1y2) 
  125.  
  126.     DrawNumber(20,140,m2x1) DrawNumber(80,140,m2y1) 
  127.     DrawNumber(100,180,m2x2) DrawNumber(160,180,m2y2) 
  128.  
  129.     GetVirtualScreenSize(Width, Height)
  130.     DrawNumber(50,200,Width) DrawNumber(100,200,Height)
  131.  
  132.     Goto Wait_for_Input
  133.     
  134.  
  135.     DebugMsgBox(Monitor_2_Name$)
  136.  
  137.     Monitor_1_Name$ = "1:   " + Monitor_1_Name$
  138.     DebugMsgBox(Monitor_1_Name$)
  139.  
  140.     MonitorFromWindow("",Monitor_1_Name$)
  141.     Monitor_1_Name$ = "2:   " + Monitor_1_Name$
  142.     DebugMsgBox(Monitor_1_Name$)
  143.  
  144.     MonitorFromRect(wx1,wy1,wx2,wy2,Monitor_1_Name$)
  145.     Monitor_1_Name$ = "3:   " + Monitor_1_Name$
  146.     DebugMsgBox(Monitor_1_Name$)
  147.  
  148.     MonitorFromPoint(100,200,Monitor_1_Name$)
  149.     Monitor_1_Name$ = "4:   " + Monitor_1_Name$
  150.     DebugMsgBox(Monitor_1_Name$)
  151.  
  152.     Goto Wait_for_Input
  153.  
  154. OpeningFile:
  155.     WaitInput(1)
  156.     UseBackground(TRANSPARENT,0,128,128)
  157.     DrawBackground
  158.     UseFont("Arial",13,27,NOBOLD,NOITALIC,NOUNDERLINE,0,0,0)
  159.     DrawText(20,60,"Display#1")
  160.     DrawText(1300,60,"Display#2")
  161.     Goto Wait_for_Input
  162.  
  163. SavingFile:
  164.     WaitInput(1)
  165.     {TODO: add file handling here}
  166.     MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
  167.                     "Saving File",Res)
  168.     Goto Wait_for_Input
  169.  
  170. PrintingFile:
  171.     WaitInput(1)
  172.     {TODO: add file handling here}
  173.     MessageBox(OK,1,INFORMATION,"No operations coded for this button.",
  174.                     "Printing File",Res)
  175.     Goto Wait_for_Input
  176.  
  177. AcceptFile:
  178.     GetDragList(FileList$)
  179.     {TODO: add file list handling here, or delete this whole label handler}
  180.     Goto Wait_for_Input
  181.     
  182. {--- Style Suggestion: place all subroutines at the end of the script.}
  183.  
  184. MakeToolbar: {subroutine}
  185.     Toolbar(    RAISED, PXL_LARGE,
  186.         NULL, NULL, SEPARATOR, "", Wait_for_Input, 
  187.         PXL_NEW, ENABLED, STD, "FileNew", CreatingFile,
  188.         PXL_OPEN, ENABLED, STD, "FileOpen", OpeningFile, 
  189.         PXL_SAVE, ENABLED, STD, "FileSave", SavingFile, 
  190.         PXL_PRINT,  ENABLED, STD,"PrintFile", PrintingFile, 
  191.         NULL, NULL, SEPARATOR, "", Wait_for_Input, 
  192.         HELPINFO, ENABLED, STD,"Show Help",ShowAppHelp) 
  193.  
  194.     Return
  195.